package com.imu.purse.modules.trade.form;

import com.alibaba.fastjson.annotation.JSONField;
import com.imu.common.validator.group.AddGroup;
import com.imu.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import java.math.BigDecimal;

@Data
public class RechargeForm {
    @JSONField(ordinal = 1)
    @ApiModelProperty(value = "充值金额", name="money", required = true, example="1")
    @NotNull(message="充值金额", groups = {AddGroup.class, UpdateGroup.class})
    @Min(value=1, message="充值金额不能小于1元", groups = {AddGroup.class, UpdateGroup.class})
    private BigDecimal money;

    @JSONField(ordinal = 2)
    @ApiModelProperty(value = "描述", hidden = true)
    @Length(max = 500, message="备注信息过长", groups = {AddGroup.class, UpdateGroup.class})
    private String detail;
}
